<template>
  <div>
    <!--导航栏-->
    <van-nav-bar
      title="消息详情"
      left-text="返回"
      left-arrow
      :fixed="true"
      @click-left="onClickLeft"
    />

    <van-cell-group>
      <van-cell :title="data.noticeTitle" value="内容">
        <p>时间：{{data.createTime}}</p>
        <p>发布人：{{data.createBy}}</p>
        <p>内容：{{data.content}}</p>
      </van-cell>
    </van-cell-group>
  </div>
</template>

<script>
  import {Toast} from "vant";
  import newApi from '@/api/news'
  export default {
    data(){
      return{
        data:'',
      }
    },
    created() {
      this.getDetail();
    },
    methods: {
      //获取详情
      getDetail(){
        newApi.getMessageInfoById({
          mesId: this.$route.query.mesId,
        })
          .then(res => {
            // 返回数据
            this.data = res;
          })
          .catch(err => {
            // 异常情况
          })
      },
      onClickLeft() {
        this.$router.push('/news')
      },
      onClickRight() {
        Toast('按钮');
      }
    }
  }
</script>

<style scoped>

</style>
